<!DOCTYPE html>


<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="layouts::header">
</head>

<body>

<nav th:replace="layouts::navbar"></nav>
<div>
    <h3>&nbsp</h3>
</div>

<div>
<div class="distance">
    <form th:action="@{/books/save}" th:object="${book}" method="POST">
               <input type="hidden" th:field="${book.bookId}">
        <div class="down">
            <input type="text" placeholder="书名" th:field="*{name}">
            <span th:if="${#fields.hasErrors('name')}" th:errors="${book.name}"></span>
        </div>
        <div class="down">
            <select th:field="*{numberId}">
                <option value="小说">小说</option>
                <option value="自然科学">自然科学</option>
                <option value="杂志">杂志</option>
                <option value="历史">历史</option>
                <option value="计算机科学">人文</option>
        </select>
        </div>
        <div class="down">
            <input type="text" placeholder="作者" th:field="*{author}">
            <span th:if="${#fields.hasErrors('author')}" th:errors="${book.author}"></span>
        </div><br>
        <input type="hidden" name="_csrf" th:value="${_csrf.token}">
        <button type="submit">新建书籍</button>
    </form>
</div>
</div>
</body>
</html>